begin tran

alter table ms_style disable trigger all
alter table ms_style_mobil disable trigger all
alter table ms_style_type_lang disable trigger all
alter table ms_stype_props disable trigger all

declare @upd_id int
select @upd_id = convert(int, var_data) from igs_parm with(updlock) where var_name = 'gv_upd_id'

select * from ms_style_type where style_type like '%-PTS%' or style_type like '%-DNS%'

update ms_style_type set style_type = replace(replace(style_type,'-DNS','-DS'), '-PTS','-PS'), upd_id = @upd_id
where style_type like '%-PTS%' or style_type like '%-DNS%'

update ms_style_type set type_tree = replace(replace(type_tree,'-DNS','-DS'), '-PTS','-PS'), upd_id = @upd_id
where type_tree like '%-PTS%' or type_tree like '%-DNS%'

alter table ms_style disable trigger all
update ms_style set style_type = replace(replace(style_type,'-DNS','-DS'), '-PTS','-PS'), upd_id = @upd_id
where style_type like '%-PTS%' or style_type like '%-DNS%'
alter table ms_style enable trigger all

update ms_style_mobil set style_type = replace(replace(style_type,'-DNS','-DS'), '-PTS','-PS')
where style_type like '%-PTS%' or style_type like '%-DNS%'

update ms_style_type_lang set style_type = replace(replace(style_type,'-DNS','-DS'), '-PTS','-PS')
where style_type like '%-PTS%' or style_type like '%-DNS%'

 update ms_stype_props set style_type = replace(replace(style_type,'-DNS','-DS'), '-PTS','-PS')
where style_type like '%-PTS%' or style_type like '%-DNS%'
 
select * from ms_style_type where style_type like '%-PTS%' or style_type like '%-DNS%' or style_type like '%-DS%'or style_type like '%-PS%'

alter table ms_style enable trigger all
alter table ms_style_mobil enable trigger all
alter table ms_style_type_lang enable trigger all
alter table ms_stype_props enable trigger all

rollback tran
 